package com.scanner.hardware.adapter;

import android.support.annotation.Nullable;

import com.scanner.bean.MotoQRBarcode;
import com.scanner.hardware.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class MotoQRAdapter extends BaseQuickAdapter<MotoQRBarcode,BaseViewHolder> {
    public MotoQRAdapter(int layoutResId, @Nullable List<MotoQRBarcode> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, MotoQRBarcode item) {
        helper.setText(R.id.tv_sigName,item.getQRcodeName());
        int codeState = item.getQRcodeState();
        if(codeState == 1){
            helper.setChecked(R.id.cb_choose,true);
        }else if(codeState == 0){
            helper.setChecked(R.id.cb_choose,false);
        }
    }
}
